package org.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.websocket.server.PathParam;

/**
 * @author : gaoziman
 * @description :
 * @date 2023/8/9 11:28
 */
@Controller
public class HelloController
{

    @GetMapping("/index/{id}")
    public String hello(Model model, @PathVariable(value = "id") String id)
    //对应函数
    {
        model.addAttribute("name","Leo");
        return "index"+id;
        //与templates中index.html对应
    }
}

